const express = require("express");
const bodyParser = require("body-parser");
const router=require('./node.js/router');
let app = express();
app.use(express.static('../../public'));
app.listen(8080,()=>{
    console.log("开始监听8080....")
});
app.use(router);
































































































//捕获路由错误，然后处理
app.use( (err,req,res,next)=>{
    //err 拦截到的错误
    console.log(err);
    //一旦出现响应500，服务器端错误
    res.send({code: 500, msg:'服务器端错误'});
  } )